package com.yixing.tech.wms.service;

import com.yixing.tech.common.base.BusinessException;
import com.yixing.tech.common.entity.ErpInventoryResult;
import com.yixing.tech.wms.param.InventoryOrderSaveParam;
import com.yixing.tech.wms.stock.out.callback.error.TaskErrorCallbackVO;
import com.yixing.tech.common.entity.WCSTaskCallbackVO;

/**
 * @author yixing tech
 * @since 1.0.0
 */
public interface InventoryService {

    boolean save(InventoryOrderSaveParam param) throws BusinessException;

    /**
     * 下架
     */
    boolean out(String orderCode) throws BusinessException;

    /**
     * 上报单个作业
     */
    boolean reportWork(String workCode) throws BusinessException;

    /**
     * 完成盘点执行回仓
     */
    boolean finishBack(String workCode) throws BusinessException;

    Object detail(String containerCode) throws BusinessException;

    /**
     * 进行盘点
     */
    boolean check(String workCode, double realNum, String inventoryNote) throws BusinessException;

    void callback(String taskCode, String method, String currentPositionCode, String podCode);

    default void callback(WCSTaskCallbackVO callbackVO){
        callback(callbackVO.getTaskCode(), callbackVO.getMethod(), callbackVO.getCurrentPositionCode(), callbackVO.getPodCode());
    }

    Object errorCallback(TaskErrorCallbackVO callbackVO) throws BusinessException;


    /**
     * 盘盈申请单审核结果
     */
    boolean erpInventoryGain(ErpInventoryResult result);

    /**
     *  盘亏申请单审核结果
     */
    boolean erpInventoryLoss(ErpInventoryResult result);

}
